package com.mall.goods.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mall.goods.mapper.CmsPrefrenceAreaMapper;
import com.mall.model.domain.CmsPrefrenceArea;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CmsPrefrenceAreaService {

    @Autowired(required = false)
    private CmsPrefrenceAreaMapper cmsPrefrenceAreaMapper;

    /**
     * 获取所有商品优选
     *
     * @return
     */
    public List listAll() {
        LambdaQueryWrapper<CmsPrefrenceArea> qw = new LambdaQueryWrapper<>();
        qw.orderByDesc(CmsPrefrenceArea::getSort);
        List<CmsPrefrenceArea> cmsPrefrenceAreas = cmsPrefrenceAreaMapper.selectList(qw);
        return cmsPrefrenceAreas;
    }
}
